n = input("输入一个正整数：")
c = 0
if n.isdigit():
    for each in n:
        c += int(each)
    print("所有位数和为：", c)
else:
    print("输入错误")
